import request from '@/utils/request';
// 列表
export function getChannelList(data) {
  return request({
    url: '/modules/channel/getChannelList',
    method: 'post',
    data
  });
}
// 新增
export function addChannel(data) {
  return request({
    url: '/modules/channel/addChannel',
    method: 'post',
    data
  });
}
// 签名标识
export function createSign(data) {
  return request({
    url: '/modules/channel/createSign',
    method: 'post',
    data
  });
}
// 编辑
export function editState(data) {
  return request({
    url: '/modules/channel/editState',
    method: 'get',
    params: data
  });
}
// 删除
export function deleteById(data) {
  return request({
    url: '/modules/channel/deleteById',
    method: 'get',
    params: data
  });
}
// 设备
export function getChannelDevice(data) {
  return request({
    url: '/modules/channel/getChannelDevice',
    method: 'post',
    data
  });
}
// 应用统计
export function channelImportantData(data) {
  return request({
    url: '/modules/channel/channelImportantData',
    method: 'post',
    data
  });
}
// 应用统计
export function channelStatisticalData(data) {
  return request({
    url: '/modules/channel/channelStatisticalData',
    method: 'post',
    data
  });
}
// 应用统计导出
export function exportChannelStatisticalData(data) {
  return request({
    url: '/modules/channel/exportChannelStatisticalData',
    method: 'post',
    data
  });
}
// 应用统计新
export function statisticalSep(data) {
  return request({
    url: '/modules/channel/statisticalSep',
    method: 'post',
    data
  });
}
// 应用统计导出新
export function exportStatisticalSep(data) {
  return request({
    url: '/modules/channel/exportStatisticalSep',
    method: 'post',
    data
  });
}
// 应用统计新
export function certInfo(data) {
  return request({
    url: '/modules/channel/certInfo',
    method: 'post',
    data
  });
}
// 应用统计导出新
export function exportCertInfo(data) {
  return request({
    url: '/modules/channel/exportCertInfo',
    method: 'post',
    data
  });
}
// 应用统计新
export function loanAssis(data) {
  return request({
    url: '/modules/channel/loanAssis',
    method: 'post',
    data
  });
}
// 应用统计导出新
export function exportLoanAssis(data) {
  return request({
    url: '/modules/channel/exportLoanAssis',
    method: 'post',
    data
  });
}
// 统计
export function channelReport(data) {
  return request({
    url: '/modules/channel/channelReport',
    method: 'post',
    data
  });
}
// 日统计
export function channelDailyReport(data) {
  return request({
    url: '/modules/channel/channelDailyReport',
    method: 'get',
    params: data
  });
}
// 获取配置
export function getChannelSetting(data) {
  return request({
    url: '/modules/channel/getChannelSetting',
    method: 'get',
    params: data
  });
}
// 认证开关配置
export function getSetting(data) {
  return request({
    url: '/modules/channel/getSetting?id=' + data.id,
    method: 'get'
  });
}
// 获取动态表单配置
export function getAllElement(data) {
  return request({
    url: '/modules/channel/getAllElement?channelId=' + data.id,
    method: 'get'
  });
}
// 更新动态表单配置
export function editElementPackage(params, data) {
  return request({
    url:
      '/modules/channel/editElementPackage?channelId=' +
      params.id +
      '&assets=' +
      params.assets,
    method: 'post',
    data
  });
}
// 更新认证配置
export function updateChannelSettingv2(data) {
  return request({
    url: '/modules/channel/updateChannelSettingv2',
    method: 'post',
    data
  });
}
// 更新认证配置
export function updateForceHeadLock(data) {
  return request({
    url: '/modules/channel/updateForceHeadLock',
    method: 'get',
    params: data
  });
}
// 更新powerSwitch
export function powerSwitch(data) {
  return request({
    url: '/modules/channel/powerSwitch',
    method: 'post',
    params: data
  });
}
// 更新退款开关
export function refundApplication(data) {
  return request({
    url: '/modules/channel/refundApplication',
    method: 'post',
    data: data
  });
}
// 更新配置
export function updateChannelSetting(data) {
  return request({
    url: '/modules/channel/updateChannelSetting',
    method: 'post',
    params: data
  });
}
// 重置密码
export function resetpwd(data) {
  return request({
    url: '/modules/channel/resetpwd',
    method: 'get',
    params: data
  });
}
// 编辑数据
export function editData(data) {
  return request({
    url: '/modules/channel/editData',
    method: 'post',
    data
  });
}
// 列表
export function getChannelAppList(data) {
  return request({
    url: '/api/channel/list',
    method: 'post',
    params: data
  });
}
// 渠道app列表
export function selectByAppList(data) {
  return request({
    url: '/api/channel/selectByAppList?channelId=' + data.id,
    method: 'post',
    data
  });
}
// listById
export function listById(data) {
  return request({
    url: '/api/channel/listById',
    method: 'post',
    params: data
  });
}
// copyAppSetting
export function copyAppSetting(data) {
  return request({
    url: '/api/channel/copyAppSetting',
    method: 'post',
    params: data
  });
}
// OneManyReplicatAppSettings
export function OneManyReplicatAppSettings(data) {
  return request({
    url: '/api/channel/OneManyReplicatAppSettings',
    method: 'post',
    data
  });
}
// 渠道app列表
export function updateByAppId(data) {
  return request({
    url: '/api/channel/updateByAppId',
    method: 'post',
    data
  });
}
export function updateBatchByAppId(data) {
  return request({
    url: '/api/channel/update-batch-by-AppId',
    method: 'post',
    data
  });
}
// 新增
export function createChannel(data) {
  return request({
    url: '/api/channel/create',
    method: 'post',
    data
  });
}
// 上传
export function upload(data) {
  return request({
    url: '/api/foundation/api/file/upload',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data
  });
}
// 查看单个渠道
export function channelById(data) {
  return request({
    url: '/api/channel/channelById',
    method: 'post',
    params: data
  });
}
// 复制渠道标签配置到多个目标端
export function copyChannelToMany(data) {
  return request({
    url: '/api/channel/copyChannelToMany',
    method: 'post',
    data
  });
}
// h5助贷开关
export function h5Switch(data) {
  return request({
    url: '/modules/channel/h5Switch',
    method: 'post',
    params: data
  });
}
// 客服状态开关
export function commonCustom(data) {
  return request({
    url: '/modules/channel/commonCustom',
    method: 'post',
    params: data
  });
}
// 根据渠道新增问题
export function addByChennelId(data) {
  return request({
    url: '/zd/problem/addByChennelId',
    method: 'post',
    data
  });
}
// 身份证实名认证开关
export function idSwitch(data) {
  return request({
    url: '/modules/channel/idSwitch',
    method: 'post',
    params: data
  });
}

// h5贷超开关
export function loanMarket(data) {
  return request({
    url: 'modules/channel/loanMarket',
    method: 'post',
    params: data
  });
}
// 长短表单开关
export function formSwitch(data) {
  return request({
    url: '/modules/channel/formSwitch',
    method: 'post',
    params: data
  });
}
// 浮窗开关
export function floatSwitch(data) {
  return request({
    url: '/modules/channel/floatSwitch',
    method: 'post',
    params: data
  });
}
// 助贷明细统计列表
export function loanCount(data) {
  return request({
    url: '/modules/channel/loanCount',
    method: 'post',
    data: data
  });
}
// 渠道数据列表
export function channelData(data) {
  return request({
    url: '/modules/channel/channelData',
    method: 'post',
    data: data
  });
}
// 助贷明细汇总
export function sumloanCount(data) {
  return request({
    url: '/modules/channel/sumloanCount ',
    method: 'post',
    data: data
  });
}

// 注册时段明细
export function getRegSumByChannel(data) {
  return request({
    url: '/modules/channel/getRegSumByChannel',
    method: 'get',
    params: data
  });
}

// 
export function getChannelData(data) {
  return request({
    url: '/channelProfit/queryChannelProfitPage',
    method: 'get',
    params: data
  });
}

export function getChannel() {
  return request({
    url: '/channelProfit/getChannel',
    method: 'get',
  });
}

// 
export function delData(data) {
  return request({
    url: `/channelProfit/deleteChannelProfit/${data}`,
    method: 'delete',
  });
}

export function addChannelProfit(data) {
  return request({
    url: '/channelProfit/addChannelProfit',
    method: 'post',
    data: data
  });
}

export function getChannelProfitRecords(data) {
  return request({
    url: '/channelProfit/getChannelProfitRecords',
    method: 'get',
    params: data
  });
}

export function addChannelProfitRecord(data) {
  return request({
    url: '/channelProfit/addChannelProfitRecord',
    method: 'post',
    data: data
  });
}

export function aList(data) {
  return request({
    url: '/channelProfit/list',
    method: 'get',
    params: data
  });
}

export function checkExtractionCode(data) {
  return request({
    url: `/channelProfit/checkExtractionCode`,
    method: 'get',
    params: data
  });
}

export function aesData(data) {
  return request({
    url: `/channelProfit/channelProfitDataList`,
    method: 'get',
    params: data
  });
}
